using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.InteropServices;

using ILRuntime.CLR.TypeSystem;
using ILRuntime.CLR.Method;
using ILRuntime.Runtime.Enviorment;
using ILRuntime.Runtime.Intepreter;
using ILRuntime.Runtime.Stack;
using ILRuntime.Reflection;
using ILRuntime.CLR.Utils;
using System.Linq;

namespace ILRuntime.Runtime.Generated
{
    unsafe class MyHandles_Binding
    {
        public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
        {
            BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
            MethodBase method;
            FieldInfo field;
            Type[] args;
            Type type = typeof(global::MyHandles);

            field = type.GetField("areaRadius", flag);
            app.RegisterCLRFieldGetter(field, get_areaRadius_0);
            app.RegisterCLRFieldSetter(field, set_areaRadius_0);
            app.RegisterCLRFieldBinding(field, CopyToStack_areaRadius_0, AssignFromStack_areaRadius_0);
            field = type.GetField("nodePoints", flag);
            app.RegisterCLRFieldGetter(field, get_nodePoints_1);
            app.RegisterCLRFieldSetter(field, set_nodePoints_1);
            app.RegisterCLRFieldBinding(field, CopyToStack_nodePoints_1, AssignFromStack_nodePoints_1);
            field = type.GetField("nodePointsRotation", flag);
            app.RegisterCLRFieldGetter(field, get_nodePointsRotation_2);
            app.RegisterCLRFieldSetter(field, set_nodePointsRotation_2);
            app.RegisterCLRFieldBinding(field, CopyToStack_nodePointsRotation_2, AssignFromStack_nodePointsRotation_2);
            field = type.GetField("isDrawLine", flag);
            app.RegisterCLRFieldGetter(field, get_isDrawLine_3);
            app.RegisterCLRFieldSetter(field, set_isDrawLine_3);
            app.RegisterCLRFieldBinding(field, CopyToStack_isDrawLine_3, AssignFromStack_isDrawLine_3);
            field = type.GetField("isOpen", flag);
            app.RegisterCLRFieldGetter(field, get_isOpen_4);
            app.RegisterCLRFieldSetter(field, set_isOpen_4);
            app.RegisterCLRFieldBinding(field, CopyToStack_isOpen_4, AssignFromStack_isOpen_4);
            field = type.GetField("animationTime", flag);
            app.RegisterCLRFieldGetter(field, get_animationTime_5);
            app.RegisterCLRFieldSetter(field, set_animationTime_5);
            app.RegisterCLRFieldBinding(field, CopyToStack_animationTime_5, AssignFromStack_animationTime_5);
            field = type.GetField("obj", flag);
            app.RegisterCLRFieldGetter(field, get_obj_6);
            app.RegisterCLRFieldSetter(field, set_obj_6);
            app.RegisterCLRFieldBinding(field, CopyToStack_obj_6, AssignFromStack_obj_6);


            app.RegisterCLRCreateDefaultInstance(type, () => new global::MyHandles());
            app.RegisterCLRCreateArrayInstance(type, s => new global::MyHandles[s]);

            args = new Type[]{};
            method = type.GetConstructor(flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Ctor_0);

        }



        static object get_areaRadius_0(ref object o)
        {
            return ((global::MyHandles)o).areaRadius;
        }

        static StackObject* CopyToStack_areaRadius_0(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((global::MyHandles)o).areaRadius;
            __ret->ObjectType = ObjectTypes.Float;
            *(float*)&__ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_areaRadius_0(ref object o, object v)
        {
            ((global::MyHandles)o).areaRadius = (System.Single)v;
        }

        static StackObject* AssignFromStack_areaRadius_0(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Single @areaRadius = *(float*)&ptr_of_this_method->Value;
            ((global::MyHandles)o).areaRadius = @areaRadius;
            return ptr_of_this_method;
        }

        static object get_nodePoints_1(ref object o)
        {
            return ((global::MyHandles)o).nodePoints;
        }

        static StackObject* CopyToStack_nodePoints_1(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((global::MyHandles)o).nodePoints;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_nodePoints_1(ref object o, object v)
        {
            ((global::MyHandles)o).nodePoints = (UnityEngine.Vector3[])v;
        }

        static StackObject* AssignFromStack_nodePoints_1(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            UnityEngine.Vector3[] @nodePoints = (UnityEngine.Vector3[])typeof(UnityEngine.Vector3[]).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((global::MyHandles)o).nodePoints = @nodePoints;
            return ptr_of_this_method;
        }

        static object get_nodePointsRotation_2(ref object o)
        {
            return ((global::MyHandles)o).nodePointsRotation;
        }

        static StackObject* CopyToStack_nodePointsRotation_2(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((global::MyHandles)o).nodePointsRotation;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_nodePointsRotation_2(ref object o, object v)
        {
            ((global::MyHandles)o).nodePointsRotation = (UnityEngine.Quaternion[])v;
        }

        static StackObject* AssignFromStack_nodePointsRotation_2(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            UnityEngine.Quaternion[] @nodePointsRotation = (UnityEngine.Quaternion[])typeof(UnityEngine.Quaternion[]).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((global::MyHandles)o).nodePointsRotation = @nodePointsRotation;
            return ptr_of_this_method;
        }

        static object get_isDrawLine_3(ref object o)
        {
            return ((global::MyHandles)o).isDrawLine;
        }

        static StackObject* CopyToStack_isDrawLine_3(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((global::MyHandles)o).isDrawLine;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method ? 1 : 0;
            return __ret + 1;
        }

        static void set_isDrawLine_3(ref object o, object v)
        {
            ((global::MyHandles)o).isDrawLine = (System.Boolean)v;
        }

        static StackObject* AssignFromStack_isDrawLine_3(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Boolean @isDrawLine = ptr_of_this_method->Value == 1;
            ((global::MyHandles)o).isDrawLine = @isDrawLine;
            return ptr_of_this_method;
        }

        static object get_isOpen_4(ref object o)
        {
            return ((global::MyHandles)o).isOpen;
        }

        static StackObject* CopyToStack_isOpen_4(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((global::MyHandles)o).isOpen;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method ? 1 : 0;
            return __ret + 1;
        }

        static void set_isOpen_4(ref object o, object v)
        {
            ((global::MyHandles)o).isOpen = (System.Boolean)v;
        }

        static StackObject* AssignFromStack_isOpen_4(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Boolean @isOpen = ptr_of_this_method->Value == 1;
            ((global::MyHandles)o).isOpen = @isOpen;
            return ptr_of_this_method;
        }

        static object get_animationTime_5(ref object o)
        {
            return ((global::MyHandles)o).animationTime;
        }

        static StackObject* CopyToStack_animationTime_5(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((global::MyHandles)o).animationTime;
            __ret->ObjectType = ObjectTypes.Float;
            *(float*)&__ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_animationTime_5(ref object o, object v)
        {
            ((global::MyHandles)o).animationTime = (System.Single)v;
        }

        static StackObject* AssignFromStack_animationTime_5(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Single @animationTime = *(float*)&ptr_of_this_method->Value;
            ((global::MyHandles)o).animationTime = @animationTime;
            return ptr_of_this_method;
        }

        static object get_obj_6(ref object o)
        {
            return ((global::MyHandles)o).obj;
        }

        static StackObject* CopyToStack_obj_6(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((global::MyHandles)o).obj;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_obj_6(ref object o, object v)
        {
            ((global::MyHandles)o).obj = (UnityEngine.GameObject)v;
        }

        static StackObject* AssignFromStack_obj_6(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            UnityEngine.GameObject @obj = (UnityEngine.GameObject)typeof(UnityEngine.GameObject).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((global::MyHandles)o).obj = @obj;
            return ptr_of_this_method;
        }



        static StackObject* Ctor_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* __ret = ILIntepreter.Minus(__esp, 0);

            var result_of_this_method = new global::MyHandles();

            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }


    }
}
